package com.pattern.once.prototype;

public class TestMain {

    public static void main(String[] args) throws CloneNotSupportedException {
        Prototype prototype = new Prototype();

        prototype.setId(1);
        prototype.setName("yuan");


        Prototype clone1 = (Prototype) prototype.clone();

        clone1.setName("11111111111111");

        System.out.println(clone1.getName());

        Prototype clone2 = (Prototype) prototype.clone();
        clone2.setName("222222222222222222");

        System.out.println(clone2.getName());
        System.out.println(prototype.getName());
        System.out.println(prototype);
        System.out.println(clone1);
        System.out.println(clone2);

    }

}
